#!/usr/bin/env python3
"""
CREATE TABLE `oneid_meta_user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `is_del` tinyint(1) NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `updated` datetime(6) DEFAULT NULL,
  `created` datetime(6) DEFAULT NULL,
  `username` varchar(255) NOT NULL,
  `password` varchar(1024) NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `mobile` varchar(64) NOT NULL,
  `employee_number` varchar(255) NOT NULL,
  `gender` int NOT NULL,
  `from_register` tinyint(1) NOT NULL,
  `is_boss` tinyint(1) NOT NULL,
  `avatar` varchar(1024) NOT NULL,
  `position` varchar(255) NOT NULL,
  `private_email` varchar(255) NOT NULL,
  `origin` int NOT NULL,
  `hiredate` datetime(6) DEFAULT NULL,
  `remark` varchar(512) NOT NULL,
  `last_active_time` datetime(6) DEFAULT NULL,
  `require_reset_password` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `username_index` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci

CREATE TABLE `inventory_user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `is_superuser` tinyint(1) NOT NULL,
  `is_staff` tinyint(1) NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `date_joined` datetime(6) NOT NULL,
  `uuid` char(32) NOT NULL,
  `is_del` tinyint(1) NOT NULL,
  `updated` datetime(6) DEFAULT NULL,
  `created` datetime(6) DEFAULT NULL,
  `username` varchar(128) NOT NULL,
  `password` varchar(128) DEFAULT NULL,
  `email` varchar(254) NOT NULL,
  `mobile` varchar(128) NOT NULL,
  `first_name` varchar(150) NOT NULL,
  `last_name` varchar(128) NOT NULL,
  `nickname` varchar(128) NOT NULL,
  `country` varchar(128) NOT NULL,
  `city` varchar(128) NOT NULL,
  `job_title` varchar(128) NOT NULL,
  `last_login` datetime(6) DEFAULT NULL,
  `avatar` varchar(256) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uuid` (`uuid`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
"""

user_table_map = ('oneid_meta_user', 'inventory_user')
user_column_map = {
    # 'id': 'id",
    'is_del': 'is_del',
    'is_active': 'is_active',
    'updated': 'updated',
    'created': 'created',
    'username': 'username',
    'password': 'password',
    'name': 'first_name',
    'email': 'email',
    'mobile': 'mobile',
    'employee_number': '',
    'gender': '',
    'from_register': '',
    'is_boss': '',
    'avatar': 'avatar',
    'position': 'job_title',
    'private_email': '',
    'origin': '',
    # 'hiredate': 'date_joined", # not null
    'remark': '',
    'last_active_time': 'last_login',
    'require_reset_password': '',
}
